<template>
  <div class="page">
    <Tabs value="name1" v-model="tabValue">
      <TabPane label="待评论" name="name1"></TabPane>
      <TabPane label="已评论" name="name2"></TabPane>
    </Tabs>
    <div class="content">
      <!--积分明细-->
      <Table v-show="tabValue == 'name2'" :columns="columns1" :data="data1"></Table>
      <Table v-show="tabValue == 'name1'" :columns="columns2" :data="data2"></Table>
      <div class="page">
        <Page :total="100" show-sizer />
      </div>
    </div>
    <Modal
        width="420px"
        class="pop"
        v-model="modal1"
        title="兑换商品">
      <div>
        <Input/>
      </div>
      <div class="pop-footer" slot="footer">
        <Button class="btn" type="primary" long>使用积分兑换</Button>
        <Button class="btn" long>
          <span>支付仓储兑换</span>
          <span class="iconfont icon-remen"></span>
        </Button>
      </div>
    </Modal>
  </div>
</template>

<script>
export default {
  name: "points",
  data() {
    return {
      modal1: false,
      tabValue: 'name1',
      columns1: [
        {
          title: '日期',
          key: 'name'
        },
        {
          title: '订单号',
          key: 'name'
        },
        {
          title: '内容',
          key: 'address'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h('Button', {
                style: {
                  marginRight: '6px'
                },
                props: {
                  size: 'small'
                },
                on: {
                  click: () => {
                    this.remove(params.index)
                  }
                }
              }, '查看详情'),
              h('Button', {
                props: {
                  type: 'error',
                  size: 'small'
                },
                on: {
                  click: () => {
                    this.remove(params.index)
                  }
                }
              }, '删除评论')
            ]);
          }
        }
      ],
      data1: [
        {
          name: 'John Brown',
          age: 18,
          address: 'New York No. 1 Lake Park',
          date: '2016-10-03'
        },
        {
          name: 'Jim Green',
          age: 24,
          address: 'London No. 1 Lake Park',
          date: '2016-10-01'
        },
        {
          name: 'Joe Black',
          age: 30,
          address: 'Sydney No. 1 Lake Park',
          date: '2016-10-02'
        },
        {
          name: 'Jon Snow',
          age: 26,
          address: 'Ottawa No. 2 Lake Park',
          date: '2016-10-04'
        }
      ],
      columns2: [
        {
          title: '日期',
          key: 'name'
        },
        {
          title: '订单号',
          key: 'name'
        },
        {
          title: '内容',
          key: 'address'
        },
        {
          title: '操作',
          key: 'action',
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h('Button', {
                style: {
                  marginRight: '6px'
                },
                props: {
                  size: 'small'
                },
                on: {
                  click: () => {
                    this.remove(params.index)
                  }
                }
              }, '查看详情'),
              h('Button', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                on: {
                  click: () => {
                    this.remove(params.index)
                  }
                }
              }, '评论订单')
            ]);
          }
        }
      ],
      data2: [
        {
          name: 'John Brown',
          age: 18,
          address: 'New York No. 1 Lake Park',
          date: '2016-10-03'
        },
        {
          name: 'Jim Green',
          age: 24,
          address: 'London No. 1 Lake Park',
          date: '2016-10-01'
        },
        {
          name: 'Joe Black',
          age: 30,
          address: 'Sydney No. 1 Lake Park',
          date: '2016-10-02'
        },
        {
          name: 'Jon Snow',
          age: 26,
          address: 'Ottawa No. 2 Lake Park',
          date: '2016-10-04'
        }
      ],
    }
  }
}
</script>

<style scoped lang="less">
.page {
  .top {
    margin-top: 24px;
    border-radius: 4px;
    margin-bottom: 32px;
    box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.08);
    background: #FFFFFF;
    overflow: hidden;
    .top-wallet {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: @primary-color;
      padding: 24px;
      .left {
        color: #FFFFFF;
        font-size: 12px;
        .text {
          display: block;
          font-size: 14px;
        }
        .num {
          display: block;
          font-size: 32px;
        }
      }
      .right {
        display: flex;
        align-items: center;
        .btn {
          width: 120px;
          background: @t-title-color;
          border: 0;
          color: #FFFFFF;
        }
        .iconfont {
          margin-left: 6px;
          color: #FFFFFF;
        }
      }
    }
    .top-content {
      padding: 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .amount {
        margin: 12px;
        color: red;
      }
      .records {
        cursor: pointer;
        color: @primary-color;
        font-size: 14px;
      }

    }
  }
  .content {
    margin-top: 32px;
    padding-bottom: 24px;
    .select-more {
      margin-bottom: 24px;
      .label {
        height: 100%;
        display: flex;
        align-items: center;
      }
    }
    .page {
      text-align: right;
      margin-top: 24px;
    }
  }
}
.pop {
  &:deep(.ivu-modal) {
    .pop-footer {
      .btn {
        margin: 0;
        margin-top: 12px;
        &:first-child {
          margin-top: 0;
        }
        .iconfont {
          color: red;
        }
      }
    }
    .ivu-modal-footer {
      border: 0;
    }
  }
}
</style>